package cn.iocoder.yudao.module.crm.enums.task;

import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * CRM 是否需要审核
 *
 * @author ZanGe丶
 * @since 2023-11-30 21:53
 */
@Getter
@AllArgsConstructor
public enum CrmTaskApproverStatus implements IntArrayValuable {
    NOT_NEED_APPROVER(0, "不需要审核"),
    IS_NEED_APPROVER(1, "需要审核");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmTaskApproverStatus::getStatus).toArray();

    /**
     * 状态
     */
    private final Integer status;
    /**
     * 状态名
     */
    private final String name;

    @Override
    public int[] array() {
        return ARRAYS;
    }

    public static boolean notNeedApprover(Integer status) {
        return ObjUtil.equal(NOT_NEED_APPROVER.status, status);
    }

    public static boolean IsNeedApprover(Integer status) {
        return ObjUtil.equal(IS_NEED_APPROVER.status, status);
    }

}
